import React, { PureComponent } from 'react'
import PropTypes from 'prop-types'
import CoreLayout from 'containers/layout'
import { connect } from 'react-redux'
import { bindActionCreators } from 'redux'
import { protoActions } from 'reduxs'
import { getDataSource, getFlagValue, showTeam, getTeamFlag, getPageFlag } from 'services/utils'
import DescriptionList from 'ant-design-pro/lib/DescriptionList'
import QueryTable from '../components/query-table'
import _ from 'lodash'

const accessFlag = getPageFlag('/proto-data/rookie-data2', 'access')
const { Description } = DescriptionList

@connect(
  state => ({
    parser              : state.Proto.parser
  }),
  dispatch => ({
    actions: bindActionCreators({ 
      ...protoActions
    }, dispatch)
  })
)
export default class RookieData2 extends PureComponent {

  render () {
    const { location, parser, paths } = this.props
    let options = {
      layoutOptions: {
        location,
        pageCode: accessFlag.value,
        breadcrumb: [
          { name: '主页', link: '/' },
          { name: '数据统计类' },
          { name: '新用户细分' }
        ],
      },
      searchOptions: {
        begin_end: {
          name: '时间段',
          format: 'YYYY-MM-DD',
          required: { required: true, message: `请选择时间段!` }
        },
        chargeEnd: {
          name: '订单截止日期',
          format: 'YYYY-MM-DD',
          required: { required: true, message: `请选择订单截止日期!` }
        },
      },
      proto: 'rookie-data2',
      tableColumns: [
        {
          key: '1',
          title: '充值0-0.99元（人数）',
          dataIndex: 'data_0',
        },
        {
          key: '2',
          title: '充值1-9元',
          dataIndex: 'data_1',
        },
        {
          key: '3',
          title: '充值10-99元',
          dataIndex: 'data_2',
        },
        {
          key: '4',
          title: '充值100-199元',
          dataIndex: 'data_3',
        },
        {
          key: '5',
          title: '充值200元以上',
          dataIndex: 'data_4',
        },
        {
          key: '6',
          title: '未充值活跃1天',
          dataIndex: 'data_5',
        },
        {
          key: '7',
          title: '未充值活跃2-6天',
          dataIndex: 'data_6',
        },
        {
          key: '8',
          title: '未充值活跃7-13天',
          dataIndex: 'data_7',
        },
        {
          key: '9',
          title: '未充值活跃14天以上',
          dataIndex: 'data_8',
        },
      ],
      tableScroll: {  },
      tablePagination: true,
      //remark: []

    }
    return (
      <QueryTable  {...options} />
    )
  }
}